import sys
import traceback

def func(a, b):
  return a / b

try:
    func(1, 0)
except Exception as e:
    import logging
    logging.basicConfig(level=logging.INFO, \
        format='%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(message)s')
    logging.exception("hahahaha")
    logging.info("hello")
